package com.springbootblog.controller.fontend.thread;

public class TestPropits implements Runnable
{
    @Override
    public void run()
    {
        String name = Thread.currentThread().getName();
        System.out.println("hello world " + name);
    }

    public static void main(String[] args)
    {
        TestPropits testPropits = new TestPropits();
        Thread thread1 = new Thread(testPropits,"1");
        Thread thread2 = new Thread(testPropits,"2");
        Thread thread3 = new Thread(testPropits,"3");
        Thread thread4 = new Thread(testPropits,"4");
        Thread thread5 = new Thread(testPropits,"5");
        Thread thread6 = new Thread(testPropits,"6");

        thread1.setPriority(Thread.MAX_PRIORITY); //10
        thread1.start();

        thread2.setPriority(Thread.MIN_PRIORITY); //1
        thread2.start();

        thread3.setPriority(Thread.NORM_PRIORITY); //5
        thread3.start();

        thread4.setPriority(3);
        thread4.start();

        thread5.setPriority(6);
        thread5.start();

        thread6.setPriority(8);
        thread6.start();
    }
}

